package net.mingsoft.basic.strategy;

import net.mingsoft.basic.biz.*;
import org.springframework.beans.factory.annotation.*;
import java.util.*;
import net.mingsoft.basic.util.*;
import net.mingsoft.basic.constant.e.*;
import net.mingsoft.basic.entity.*;

public class ManagerModelStrategy implements IModelStrategy
{
    @Autowired
    private IModelBiz modelBiz;
    
    @Override
    public List<ModelEntity> list() {
        final ManagerEntity manager = BasicUtil.getManager();
        assert manager != null;
        List<ModelEntity> parentModelList;
        if (manager.getManagerAdmin().equals(ManagerAdminEnum.SUPER.toString())) {
            parentModelList = (List<ModelEntity>)this.modelBiz.list();
        }
        else {
            parentModelList = this.modelBiz.queryModelByRoleId(manager.getRoleId());
        }
        return parentModelList;
    }
}
